﻿using Lhz.Sc.Entity.Database;
using System;
using System.Linq;

namespace Lhz.Sc.Business
{
    public static class AuthorizationQueryableExpansion
    {
        public static IQueryable<Authorization> QueryByUserGuid(this IQueryable<Authorization> query, Guid? userGuid)
        {
            if (userGuid.HasValue)
            {
                query = query.Where(r => r.UserGuid == userGuid.Value);
            }
            return query;
        }
    }
}
